package com.dj.myapp.service;

import com.dj.mylibrary.param.UriParam;
import com.dj.mylibrary.router.Router;
import ohos.aafwk.ability.AbilitySlice;

import java.util.HashMap;

public class RouterService {

    public RouterService() {
        if(null==mRouter){
            mRouter= Router.getInstance();
        }
    }

    private Router mRouter;


    /*...
        @CombinationUri(scheme = "router", host = "com.baronzhang.android.router.SecondActivity")
        @UriParam("preActivity") String preActivity, @IntentExtrasParam("stringParam") String stringParam, @IntentExtrasParam("intParam") int intParam
        routerService.startSecondActivity("MainActivity", "181818", 22222);
        ...*/
    public void toOtherAbility(AbilitySlice slice, UriParam param, HashMap<String,Object> data){

        mRouter.startJump(slice,param,data,null);

    }

    public void toOtherSlice(AbilitySlice slice, HashMap<String,Object> data,Class<?extends AbilitySlice> cls){

        mRouter.startJump(slice,null,data,cls);

    }



//    public HashMap<String,Object> inject(Intent intent, InjectParam param){
//        return mRouter.inject(intent,param);
//    }




}
